//
//  JourneyPhotoCollectionViewCell.m
//  Travel_M_Travel
//
//  Created by APPLE10 on 15-3-27.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "JourneyPhotoCollectionViewCell.h"

@implementation JourneyPhotoCollectionViewCell

-(void)dealloc
{
    [_photoImageView release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.photoImageView = [[UIImageView alloc]initWithFrame:self.contentView.bounds];
        //        _photoImageView.backgroundColor = [UIColor yellowColor];
        _photoImageView.layer.cornerRadius = 10;
        _photoImageView.clipsToBounds = YES;
        [self addSubview:_photoImageView];
        [_photoImageView release];
    }
    
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    
}

- (void)setPhotoData:(JourneyPhotoDataSource *)photoData
{
    if (_photoData != photoData) {
        [_photoData release];
        _photoData = [photoData retain];
    }
    
    NSString *str = _photoData.photo_s;
    NSURL *url = [NSURL URLWithString:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    
    [_photoImageView setImageWithURL:url];
}

@end
